////////////////////////////////////////////////////////////////////////////////
// Copyright 2010 Michael Schmalle - Teoti Graphix, LLC
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0 
// 
// Unless required by applicable law or agreed to in writing, software 
// distributed under the License is distributed on an "AS IS" BASIS, 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and 
// limitations under the License
// 
// Author: Michael Schmalle, Principal Architect
// mschmalle at teotigraphix dot com
////////////////////////////////////////////////////////////////////////////////

package org.teotigraphix.swizplugin.registry.core
{

import org.teotigraphix.swizplugin.registry.IContributor;

/**
 * A contributor to the registry, extension point, extension or
 * extension descriptor.
 * 
 * @author Michael Schmalle
 * @copyright Teoti Graphix, LLC
 * @productversion 1.0
 */
public class RegistryContributor implements IContributor
{
	//--------------------------------------------------------------------------
	//
	//  IContributor API :: Properties
	//
	//--------------------------------------------------------------------------
	
	//----------------------------------
	//  id
	//----------------------------------
	
	/**
	 * @private
	 */
	private var _id:int;
	
	/**
	 * @copy swizplugin.IContributor#id
	 */
	public function get id():int
	{
		return _id;
	}
	
	//----------------------------------
	//  name
	//----------------------------------
	
	/**
	 * @private
	 */
	private var _name:String;
	
	/**
	 * @copy swizplugin.IContributor#name
	 */
	public function get name():String
	{
		return _name;
	}
	
	//--------------------------------------------------------------------------
	//
	//  Constructor
	//
	//--------------------------------------------------------------------------
	
	/**
	 * Constructor for the registry contributor.
	 * 
	 * @param contributorID The unique interger id of the contributor.
	 * @param contributorName The unique string name of the contributor.
	 */
	public function RegistryContributor(contributorID:int, 
										contributorName:String)
	{
		_id = contributorID;
		_name = contributorName;
	}
	
	//--------------------------------------------------------------------------
	//
	//  Public :: Methods
	//
	//--------------------------------------------------------------------------
	
	/**
	 * Returns a string representation.
	 */
	public function toString():String
	{
		return _name + "[" + _id + "]";
	}
}
}